function showVideoMonitorRecordSearch() {
	window.location.href = "showVideoMonitorRecordSearch.do";
}

function ajaxFindVideoMonitorRecordSearchList(currentPage,pageSize) {
	$.ajax({
		type : "post",
		url : "ajaxVideoMonitorRecordSearchList.do",
		data : {
			currentPage:currentPage,
			pageSize:pageSize,
		},
		success : function(msg) {
			$("#listVideoMonitorRecordBox").html(msg);
		}
	});
}

function ajaxDeleteVideoMonitorRecordById(id) {
	var VideoMonitorRecordIds="";
	var sltVMR = $("#listVideoMonitorRecordList tbody input:checked").length;
	if(id==null){
		$("#listVideoMonitorRecordList tbody input:checked").each(function(){ 
			VideoMonitorRecordIds += $(this).val()+";";
		});
		if(sltVMR == 0){
			showMessageDialog("提示","请选择一行或多行",null,dialogType.info);
			return;
		}else{
			VideoMonitorRecordIds = VideoMonitorRecordIds.substring(0, VideoMonitorRecordIds.length-1);
		} 
	}else{
		VideoMonitorRecordIds=id;
		sltVMR = 1;
	}
	if( VideoMonitorRecordIds!=null){
		showMessageDialog("删除监控视频","确定要删除所选“"+sltVMR+"”条监控视频记录吗？",
				function () {
			$.ajax({     
				type:"post",
				url:"ajaxDeleteVideoMonitorRecordByIds.do",
				data:{VideoMonitorRecordIds:VideoMonitorRecordIds},
				success:function(msg){
					ajaxFindVideoMonitorRecordSearchList();
					showMessageDialog("提示","监控视频删除成功",null,dialogType.info);
				}
			});
		}
		,dialogType.warning);
	}
}

function ajaxShowVideoMonitorRecordView(id){
	$.ajax({
		type:"post",
		url:"ajaxShowVideoMonitorRecordView.do",
		data:{videoMonitorRecordId:id},
		success:function(msg){
			$("#dialog").html(msg);
			$("#dialog").dialog({
				autoOpen: true,
				width: 800,
				title:$(".dialogtitle").attr("title"),
				modal: true,
				buttons: [
				          {
				        	  text: "关闭",
				        	  click: function() {
				        		  $(this).dialog( "close" );
				        	  }
				          }
				          ]
			});
		}
	});
}

